#include "mybutton.h"
#include<QDebug>
MyButton::MyButton(QWidget *parent) : QPushButton(parent)
{  
   this->setAutoFillBackground(true);
}

void MyButton::set(QString normal, QString enter, QString chicked)
{
     this->m_normal=normal;
     this->m_enter=enter;
     this->m_chicked=chicked;
     this->m_falg=false;
     this->setStyleSheet(this->m_normal );
}
void MyButton::enterEvent(QEvent *ev)
{
    Q_UNUSED(ev);
    if(!this->m_falg){
      this->setStyleSheet(this->m_enter);
    }
    update();
}

void MyButton::leaveEvent(QEvent *ev)
{
    Q_UNUSED(ev);
    if(!this->m_falg){
       this->setStyleSheet(this->m_normal);
    }
    update();
}
